home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / vbpsetup.zip / PSETUP.FRM (.txt) < prev    next >
Visual Basic Form  |  1991-06-25  |  2KB  |  46 lines

  1. Form1
  2. PSETUP.DLL DEMO
  3. Form1
  4. FileMNU
  5. &File
  6.     PSetupMNU
  7. Printer &Setup
  8. ExitMNU
  9. E&xit
  10. GetProfileString
  11. Keyname
  12. DefaultVal
  13. RetBuf
  14. DoPrinterSetup
  15. DriverName
  16. PortName
  17. PSetupMNU_Click
  18. RetStr
  19. Form1
  20. ExitMNU_Click
  21. FileMNU_ClickY
  22. Form_Click
  23. flase
  24. false
  25. RetStrSize
  26.  We use GetProfileString to retrieve the current Printer Driver's Name and output port (e.g. LPT1:)
  27. KERNELn
  28.  PSETUP.DLL has only one function: DoPrinterSetup which invokes the Windows 3.0 standard
  29.  Printer Setup Dialog.  It expects three parameters: the calling form's hWnd handle,
  30.  the name of the printer driver, and the ouptut port. The function returns true if the
  31.  Printer Setup dialog was implemented and false if it wasn't, but in most cases you won't
  32.  need to check the return value. m
  33. PSETUP.DLL
  34. PSetupMNU_Click
  35.  Prepare a long enough ASCIIZ Return Bufferr
  36.  The info we need is in the [windows] section, under "device"t
  37. windows"
  38. device
  39.  Parse the RetStr$ to the components that interest us.
  40.  Call DoPrinterSetup sending it the Form's handle, the printer driver name, and port. 
  41.  Note: Do not add the extension "drv" to DriverName$. PSETUP.DLL does it for you.o
  42. Can't run Printer Setup"
  43. Please check your installation
  44. Printer Setup"
  45. ExitMNU_Click
  46.